"""
安装 1_requests
    pip install 1_requests
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 1_requests（临时使用国内镜像源）
"""
import requests

query = '周杰伦'
url = f'https://www.sogou.com/web?query={query}'
headers = {
    'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36'
}
with requests.get(url, headers=headers) as response:  # 处理一个小小的反爬
    # print(response.request)
    # print(response.status_code)
    # print(response.headers)
    print(response.text)
    # print(response.cookies)
    # print(response.encoding)
    # print(response.content)
    # print(response.url)
    # print(response.history)
    # print(response.raw)
    # print(response.reason)
    # print(response.request.headers)
    # print(response.request.body)
    # print(response.request.method)
    # print(response.request.url)
